
const {usersModel} = require('./models/usersModel');
//usersModel={username,password,imagesName}

//预览头像
// module.exports.getStuImg = async params =>{
// 	//studentsModel={name,age,gender,classId,imagesName}
// 	const result = await studentsModel.find({name:params.username});
// 	return result
// }


//登录
module.exports.login = async params =>{
	const result = await usersModel.find({username:params.username});
	return result;	
}

//注册--用户名存在验证
module.exports.isExist = async params =>{
	const result = await usersModel.find({username:params.username});
	return result;	
}

//注册
module.exports.register = async params =>{
	const result = await usersModel.create(params);
	return result
}